package com.cqie.rbac.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

/**
 * <p>
 * 用户实体
 * </p>
 *
 * @author 夏兵
 * @since 2021-09-02
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString
@NoArgsConstructor
public class SysUser extends Model implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    private String name;

    /**
     * 登陆账号
     */
    private String account;

    /**
     * 登陆密码
     */
    private String password;

    /**
     * 状态 0：正常 1：禁用
     */
    private Integer status;

    /**
     * 修改时间
     */
    private Date modifyTime;

    /**
     * 创建时间
     */
    private Date createTime;

    public SysUser(Long id, Integer status) {
        this.id = id;
        this.status = status;
    }

    @TableField(exist = false)
    private Set<String> permissionCodes;
}
